# What the Emacs 19 binary is called on your system
EMACS = @EMACS@

# Shared directory for read-only data files
datadir = $(prefix)/share

# Where to put the .el and .elc files
lispdir=$(datadir)/emacs/site-lisp

DIST_SOURCES = hexl+.el
OBJECTS = hexl+.elc

.el.elc:
	$(EMACS) -batch -f batch-byte-compile $<

all: $(OBJECTS)

install: all installdirs
	for f in $(DIST_SOURCES); do \
	  $(INSTALL_DATA) $(srcdir)/$$f $(lispdir); \
	done;
	for f in $(OBJECTS); do \
	  $(INSTALL_DATA) $$f $(lispdir); \
	done;

# Make sure all installation directories actually exist
# by making them if necessary.
installdirs: mkinstalldirs
	$(srcdir)/mkinstalldirs $(lispdir)

uninstall:
	-cd $(lispdir) && rm -f $(DIST_SOURCES) $(OBJECTS)

TAGS: $(DIST_SOURCES)
	cd $(srcdir) && etags $(DIST_SOURCES)

clean:
	rm -f $(OBJECTS)
	-rm -f *.aux *.cp *.cps *.fn *.ky *.log *.pg *.toc *.tp *.vr
	-rm -f *.html
	rm -f TAGS
